package com.bdqn.thymeleaf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bdqn.thymeleaf.mapper.UserMapper;
import com.bdqn.thymeleaf.pojo.User;
import com.bdqn.thymeleaf.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User login(String usrName, String usrPassword) {
        return null;
    }

    @Override
    public int addUser(User user) {
        return 0;
    }

    @Override
    public int deleteUser(Long usrId) {
        return 0;
    }

    @Override
    public int updateUser(User user) {
        return 0;
    }

    @Override
    public User getUserById(Long usrId) {
        return userMapper.selectOne(new QueryWrapper<>(User.class).eq("usr_id",usrId));
    }

    @Override
    public List<User> findAllUsers() {
        return List.of();
    }
}
